package com.fannnnn.system.controller;


import com.fannnnn.system.pojo.User;
import com.fannnnn.system.service.impl.UserServiceImpl;
import com.fannnnn.system.vo.Result;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author shensifan
 * @since 2022-01-26
 */
@RestController
@RequestMapping("/system/user")
@Api(tags = "用户接口")
@PreAuthorize("hasAuthority('system/dept/list')")
public class UserController {

    @Autowired
    UserServiceImpl userService;

    @GetMapping("/userlist")
    public Result getUserList(){
        User user = userService.getById(1);
        return new Result(200,"请求成功",user);
    }

    @GetMapping("/test")
    public String test(){
        return "test successful!";
    }

}

